package com.yunao.web.convert;


import com.yunao.entity.Organization;
import com.yunao.service.report.DateUtil;
import com.yunao.web.form.OrganizationForm;

public class OrganizationForm2OrganizationConverter {
    public static Organization convert(OrganizationForm organForm){
        Organization organ = new Organization();
        if (organForm.getId()!=null){
            organ.setOrganId(organForm.getId());
        }
        organ.setOrganName(organForm.getName());
        organ.setOrganShortName(organForm.getShortname());
        organ.setOrganPerson(organForm.getPerson());
        organ.setOrganEmail(organForm.getEmail());
        organ.setOrganMobile(organForm.getMobile());
        organ.setOrganTelephone(organForm.getTelephone());
        organ.setOrganLocaltion(organForm.getLocaltion());
        organ.setOrganTrade(organForm.getTrade());
        organ.setOrganExpireDate(DateUtil.getDate(organForm.getExpireDate()));
        organ.setOrganUserCeiling(organForm.getUserCeiling());
        organ.setOrganSubjectCeiling(organForm.getSubjectCeiling());
        organ.setOrganUserNum(0);
        organ.setOrganSubjectNum(0);
        return organ;
    }
}
